package com.wn.ticket.service.impl;


import com.wn.ticket.entity.Coupon;
import com.wn.ticket.entity.User;
import com.wn.ticket.entity.UserCoupon;
import com.wn.ticket.mapper.UserCouponMapper;
import com.wn.ticket.service.CouponService;
import com.wn.ticket.service.UserCouponService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserCouponServiceImpl implements UserCouponService {

    @Autowired
    private UserCouponMapper userCouponMapper;


    @Override
    public void add(UserCoupon usercoupon) {
        userCouponMapper.insert(usercoupon);
    }

    @Override
    public void del(int userId, int couponId) {
        userCouponMapper.del(userId, couponId);
    }

    @Override
    public List<UserCoupon> getByUserId(int userId) {
        return userCouponMapper.getByUserId(userId);
    }

    @Override
    public void UCupdate(UserCoupon userCoupon) {
        userCouponMapper.update(userCoupon);
    }


}
